<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>登陆</title>
		<script type="text/javascript">
			function tijiao(){
				var fr = document.form1;
				if(fr.xm.value==""){
					alert("学号必须填写！");
					fr.xm.focus();
					return false;
				}
				if(fr.ps.value==""){
					alert("密码必须填写！");
					fr.ps.focus();
					return false;
				}
			}
		
			function reset(){
				var fr = document.form1;
				fr.xm.value = "";
				fr.ps.value = "";
			}
		</script>
	</head>
	<body>
		<div>
			<h1>用户登录</h1>
			<form action="spider.php" method="post" name="form1">
				学号：<input type="text" id="name" name="xm"/>
				密码：<input type="password" id="password" name="ps" />
				<input type="submit" value="提交" class="button" id="submit" onclick="return tijiao()"/>
				<input type="reset" value="重置" class="button" id="reset" onclick="reset()"/>
			</form>
		</div>	
	</body>
	<style>
		h1{
			font-size: 20px;
		}

		div{
			text-align: center;
			width: 200px;
			padding: 1em 2em 0 2em;
			font-size: 12px;
		}

		#name,#password{
	
			border: 1px solid #ccc;
			width: 170px;
			height: 22px;
			padding-left: 20px;
			margin: 6px 0;
			line-height: 20px;
		}

		.button{
			margin: 6px 0;
		}

	</style>
</html>